#ifndef __ATOMTRACE_PINHOLECAMERA_H
#define __ATOMTRACE_PINHOLECAMERA_H

#include "Vector3.h"
#include "Ray.h"

namespace AtomTrace{

    //class Ray;

    class PinHoleCamera{
    private:
        Vector3 blPix; // the bottom left corner pixel
        //Vector3 right;
        //Vector3 dir;
        Vector3 dx;
        Vector3 dy;
    public:
        int imgWidth;
        int imgHeight;
        float focalDst;
        float fovy; // this is tan(fovy)

        Vector3 position;
        Vector3 dir;
        Vector3 up;

        PinHoleCamera();
        inline PinHoleCamera(int address);
        inline const PinHoleCamera & LoadFromGM(int addr);
        void Init();

        void UpdateCamParameter();

        const Ray CastRay(int pix) const;
        const Ray CastRay(int ix, int iy) const;
    };

    //inline const PinHoleCamera LoadPinholeCameraFromGM(int address);

}// namespace AtomTrace

#include "PinHoleCamera.inl"

#endif //__ATOMTRACE_PINHOLECAMERA_H
